-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix build when targeting Windows 7 as platform. #1869
Conversation
This change makes more of the code introduced in yhirose#1775 conditional on feature macros. `CreateFile2`, `CreateFileMappingFromApp` and `MapViewOfFileFromApp` are available only starting from Windows 8. * https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfile2 * https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-createfilemappingfromapp * https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-mapviewoffilefromapp
@yhirose win7 boxes are still widely available, great downstream projects like llama.cpp are using this great library, I hope it can support win7. ggerganov/llama.cpp#8208 @mol123 I think your code can work but for the actual condition according to win11 sdk header file:
|
|
@mol123 thanks for the pull request. Could you confirm that Win8 or later use the new APIs and Win7 or lower uses the old APIs? Once you test and confirm it, please let me know. |
I've tested the code on both Windows 7 and Windows 10 (>= Windows8) and can confirm that it works. Details: I've created the following test program:
I've compiled it:
On Windows 10, both On Windows 7, |
I pull the latest code,compile using VS2017, system is win11. |
@qwe857359351a: the code has to be compiled targeting Windows 7 as minimal version, specifically setting See: |
Thinks, already able to run. |
- Include yhirose/cpp-httplib#1869 for fix build on mingw
This change makes more of the code introduced in
#1775
conditional on feature macros.
CreateFile2
,CreateFileMappingFromApp
andMapViewOfFileFromApp
are available only starting from Windows 8.